﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;


namespace nadModel.config
{
    public class config
    {
        public static bool GetTuoch()
        {
            StreamReader sr = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "//config//config.txt");
            string s = sr.ReadLine();
            sr.Dispose();
            if (string.IsNullOrEmpty(s)) return false;
            return bool.Parse(s.Split(':')[1]);
        }

        public static string GetCompany()
        {
            StreamReader sr = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "//config//config.txt");
            string s = "";
            string com = "";
            while (s != null)
            {
                s = sr.ReadLine();
                if (s != null && s != "" && s.StartsWith("Company"))
                {
                    com = s.Split(':')[1];
                    break;
                }
            }

            sr.Dispose();
            return string.IsNullOrEmpty(com) ? "NSZ" : com;
        }
    }
}
